import request from '@/utils/request'

// 获取报名列表
// 获取大类
export function getApplyList() {
  return request({
    url: '/work/apply/list',
    method: 'get',
  })
}
export function getApplyCan(params) {
  return request({
    url: '/work/apply/isCanApply?completetionId=' + params,
    method: 'get',
  })
}
// 获取比赛项目列表
export function getApplyProject(params) {
  return request({
    url: '/work/apply/'+ params,
    method: 'get',
  })
}

// 获取大类
export function getCompetitionType(params) {
  return request({
    url: '/work/apply/getApplyTypeDic',
    method: 'get',
    params:params
  })
}

// 获取小类
export function getCompetitionProject(params) {
  return request({
    url: '/work/apply/getApplyProjectDic',
    method: 'get',
    params:params
  })
}


// 获取组别
export function getCompetitionGroup(params) {
  return request({
    url: '/work/apply/getApplyGroupsDic',
    method: 'get',
    params:params
  })
}


// 保存或修改报名
export function saveApply(data) {
  return request({
    url: '/work/apply/saveOrUpdate',
    method: 'post',
    data:data
  })
}

// 上传文件
export function reqUploadMusic(file,onUploadProgress) {
  return request({
    url: '/work/apply/uploadMusic',
    method: 'post',
    headers: {
      "content-type": "multipart/form-data",
    },
    data: file,
    onUploadProgress: onUploadProgress
  })
}

// 上传缴费凭证
export function uploadPayPic(file) {
  return request({
    url: '/work/apply/uploadPayPic',
    method: 'post',
    headers: {
      "content-type": "multipart/form-data",
    },
    data: file
  })
}

// 提交报名
export function submitApply(params) {
  return request({
    url: '/work/apply/submitApply',
    method: 'get',
    params:params
  })
}

export function deleteApply(params) {
  return request({
    url: '/work/apply/delete-by-id',
    method: 'get',
    params:params
  })
}

